from pygo1963.model.Player import HumanPlayer, AlphaBetaPlayer, RandomPlayer
from pygo1963.model.Constants import BLACK_COLOR, WHITE_COLOR

HUMAN_KEY = "Human"
ALPHA_BETA_KEY = "Pygo"
RANDOM_KEY = "Random"

def create_players(player1, player2, controller):
        
    return (create_player(player1, BLACK_COLOR, controller),
    create_player(player2, WHITE_COLOR, controller))
    
#TODO tratar de cambiar esto
def create_player(player, color, controller):
    
    if player == HUMAN_KEY:    
        return HumanPlayer(color, controller)        
    elif player == ALPHA_BETA_KEY:    
        return AlphaBetaPlayer(color)
    elif player == RANDOM_KEY:    
        return RandomPlayer(color)
    else:    
        return None
